home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Language/OS - Multiplatform Resource Library
/
LANGUAGE OS.iso
/
oper_sys
/
presto
/
prest1_0.lha
/
Tests
/
sos
/
set.h
< prev
next >
Wrap
C/C++ Source or Header
|
1991-12-11
|
508b
|
29 lines
//
// A "set" is a representation for a set of elements drawn from
// a collection of 128 elements (integers 0-127).
//
// The implementation is pretty sick. The number 128 is basically
// hardcoded, and it is assumed that "unsigned" has 32 bits.
//
#define MAXSIZE 128
class Set: public Object {
unsigned s_members[4];
int s_total;
public:
Set();
~Set();
Set *clone();
void include(int m);
void remove(int m);
int ismember(int e);
int sum()
{ return s_total; }
void print(ostream &s);
};